package com.neusoft.neuiotms.dcom.converter.malfunction;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.malfunction.MalfunctionCustomerReviewAnnexDTO;
import com.neusoft.neuiotms.dcom.model.malfunction.MalfunctionCustomerReviewAnnex;

@Component
public class MalfunctionCustomerReviewAnnexConverter
        extends AbstractConverter<MalfunctionCustomerReviewAnnex, MalfunctionCustomerReviewAnnexDTO> {

    @Override
    public MalfunctionCustomerReviewAnnex toModel(final MalfunctionCustomerReviewAnnexDTO dto) {

        final MalfunctionCustomerReviewAnnex model = new MalfunctionCustomerReviewAnnex();
        model.setFsId(dto.getFsId());
        model.setName(dto.getName());
        return model;
    }

    @Override
    public MalfunctionCustomerReviewAnnexDTO toDTO(final MalfunctionCustomerReviewAnnex model,
            final boolean forListView) {

        final MalfunctionCustomerReviewAnnexDTO dto = new MalfunctionCustomerReviewAnnexDTO();
        dto.setId(model.getId());
        dto.setFsId(model.getFsId());
        dto.setName(model.getName());
        return dto;
    }

}
